04. Quizzes: Test Doubles

Quizzes: Test Doubles

QUIZ QUESTION::

Which test double can you use to fulfill each function?

ANSWER CHOICES:



Function

Test Double

Keep track of which methods were called

Always return a hard-coded value

Provide a non-null object that doesn't perform any behavior

Allow you to customize the return values for different input parameters

SOLUTION:

Function

Test Double

Always return a hard-coded value

Keep track of which methods were called

Provide a non-null object that doesn't perform any behavior

Allow you to customize the return values for different input parameters

Why do we need to use Test Doubles at all?

SOLUTION: Verify the behavior of the tested class without relying on its dependencies performing particular actions.